function res = getgreeks(obj,instrument)
    if ischar(instrument)
        instrument = code2instrument(instrument);
    end
    
    if isa(instrument,'cFutures')
        flag = obj.underliers_.hasinstrument(instrument);
        if ~flag
            res = {};
            return
        end
        qu = obj.qms_.getquote(instrument);
        mult = instrument.contract_size;
        code_ctp = instrument.code_ctp;
        data = cDataFileIO.loadDataFromTxtFile([code_ctp,'_daily.txt']);
        idx = data(:,1) == getlastbusinessdate;
        pclose = data(idx,5);
        
        res = struct('code',code_ctp,...
             'delta',qu.last_trade*mult,...
            'gamma',0,...
            'vega',0,...
            'theta',0,...
            'impvol',0,...
            'deltacarry',qu.last_trade*mult,...
            'gammacarry',0,...
            'vegacarry',0,...
            'thetcarry',0,...
            'deltacarryyesterday',pclose*mult,...
            'gammacarryyesterday',0,...
            'vegacarryyesterday',0,...
            'thetacarryyesterday',0,...
            'impvolcarryyesterday',0,...
            'pvcarryyesterday',0);    
    elseif isa(instrument,'cOption')
        [flag,idx] = obj.options_.hasinstrument(instrument);
        if ~flag
            res = {};
            return
        end
        options = obj.options_.getinstrument;
    
        code_ctp = options{idx}.code_ctp;
    
        res = struct('code',code_ctp,...
            'delta',obj.delta_(idx),...
            'gamma',obj.gamma_(idx),...
            'vega',obj.vega_(idx),...
            'theta',obj.theta_(idx),...
            'impvol',obj.impvol_(idx),...
            'deltacarry',obj.deltacarry_(idx),...
            'gammacarry',obj.gammacarry_(idx),...
            'vegacarry',obj.vegacarry_(idx),...
            'thetcarry',obj.thetacarry_(idx),...
            'deltacarryyesterday',obj.deltacarryyesterday_(idx),...
            'gammacarryyesterday',obj.gammacarryyesterday_(idx),...
            'vegacarryyesterday',obj.vegacarryyesterday_(idx),...
            'thetacarryyesterday',obj.thetacarryyesterday_(idx),...
            'impvolcarryyesterday',obj.impvolcarryyesterday_(idx),...
            'pvcarryyesterday',obj.pvcarryyesterday_(idx));
    end    
    
end